package com.zhanghe.im.handler;

import com.zhanghe.im.request.HeartBeatRequestPacket;
import com.zhanghe.im.response.HeartBeatResponsePacket;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class SimpleHeartBeatRequestHandler extends SimpleChannelInboundHandler<HeartBeatRequestPacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, HeartBeatRequestPacket msg) throws Exception {
        System.out.println("接收到心跳包");
        ctx.channel().writeAndFlush(new HeartBeatResponsePacket());
    }
}
